def isPerfectNumber(x):
    if x <=0:
        return False
    s = 0
    for i in range(1, x):
        if x % i == 0:
            s += i
    return s==x   
n=eval(input("请输入数字x"))
print( isPerfectNumber(n))